package com.bustle.web.mbean.request;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

import com.bustle.order.data.Account;
import com.bustle.order.data.Lineitem;
import com.bustle.order.data.Order;
import com.bustle.order.data.Order.OrderStatus;
import com.bustle.order.data.Payment;
import com.bustle.order.data.dao.AccountDao;
import com.bustle.order.data.dao.LineitemDao;
import com.bustle.order.data.dao.OrderDao;
import com.bustle.order.data.dao.PaymentDao;
import com.bustle.product.data.Product;
import com.bustle.product.data.Product.ProductType;
import com.bustle.product.data.Provider;
import com.bustle.product.data.dao.ProductDao;
import com.bustle.product.data.dao.ProviderDao;
import com.bustle.user.data.Address;
import com.bustle.user.data.Authentication;
import com.bustle.user.data.User;
import com.bustle.user.data.User.Type;
import com.bustle.user.data.dao.AddressDao;
import com.bustle.user.data.dao.AuthenticationDao;
import com.bustle.user.data.dao.UserDao;

@ManagedBean(name = "jd")
@RequestScoped
public class InjectIntoDatabase
{

  @EJB
  protected AuthenticationDao authenticationDao;
  @EJB
  protected UserDao userDao;
  @EJB
  protected AddressDao addressDao;
  @EJB
  protected ProductDao productDao;
  @EJB
  protected AccountDao accountDao;
  @EJB
  protected OrderDao orderDao;
  @EJB
  protected PaymentDao paymentDao;
  @EJB
  protected LineitemDao lineDao;
  @EJB
  protected ProviderDao providerDao;

  SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");

  public String inject()
  {


    //////////////////////////////////////////////////////
    ///                    Address                    ///
    /////////////////////////////////////////////////////
    Address addressUser1 = new Address();
    addressUser1.setName_street("7, rue des Saints Sauveurs");
    addressUser1.setPostcode("92260");
    addressUser1.setCity("Fontenay-aux-Roses");

    Address addressUser2 = new Address();
    addressUser2.setName_street("23, rue Gambetta");
    addressUser2.setPostcode("92240");
    addressUser2.setCity("Malakoff");

    Address addressUser3 = new Address();
    addressUser3.setName_street("35, rue Maurice Ténine");
    addressUser3.setPostcode("94260");
    addressUser3.setCity("Fresnes");

    Address addressProvider1 = new Address();
    addressProvider1.setName_street("4, avenue de Paris");
    addressProvider1.setPostcode("78011");
    addressProvider1.setCity("Versailles cedex");
    addressDao.create(addressProvider1);

    Address addressProvider2 = new Address();
    addressProvider2.setName_street("22, rue du Général de Gaulle");
    addressProvider2.setPostcode("78120");
    addressProvider2.setCity("Rambouillet");
    addressDao.create(addressProvider2);

    Address addressProvider3 = new Address();
    addressProvider3.setName_street("106, rue Cardinet");
    addressProvider3.setPostcode("75017");
    addressProvider3.setCity("Paris");
    addressDao.create(addressProvider3);

    Address addressProvider4 = new Address();
    addressProvider4.setName_street("rue de Rivoli");
    addressProvider4.setPostcode("75001");
    addressProvider4.setCity("Paris");
    addressDao.create(addressProvider4);

    Address addressProvider5 = new Address();
    addressProvider5.setName_street("1, avenue du Maréchal Leclerc");
    addressProvider5.setPostcode("64109");
    addressProvider5.setCity("Bayonne cedex");
    addressDao.create(addressProvider5);

    //////////////////////////////////////////////////////
    ///                    Provider                   ///
    /////////////////////////////////////////////////////

    Provider provider1 = new Provider();
    provider1.setAddress(addressProvider1);
    provider1.setName("Ville de Versailles");
    provider1.setPhoneNumber("+33 1 30 97 80 00");
    provider1.setEmail("contact@mairie-versailles.fr");
    provider1.setDescription("Commune française située dans le département des Yvelines, dans la région Île-de-France, mondialement connue pour son château ainsi que pour son parc, sites classés sous l’égide de l'UNESCO dans la liste du patrimoine mondial de l’humanité.");
    provider1.setImage("img/provider/versailles.png");
    provider1.setMap("http://goo.gl/maps/HQbP8");
    providerDao.create(provider1);

    Provider provider2 = new Provider();
    provider2.setAddress(addressProvider2);
    provider2.setName("Beauty Success");
    provider2.setPhoneNumber("+33 1 30 88 84 19");
    provider2.setEmail("contact@beauty-success.fr");
    provider2.setDescription("Parfumerie et salon d'esthétique situé dans la ville de Rambouillet.");
    provider2.setImage("img/provider/beautySuccess.png");
    provider2.setMap("http://goo.gl/maps/egavK");
    providerDao.create(provider2);

    Provider provider3 = new Provider();
    provider3.setAddress(addressProvider3);
    provider3.setName("Aquabike Seventeen");
    provider3.setPhoneNumber("+33 1 47 64 80 18");
    provider3.setEmail("aquabike@aquabike-seventeen.fr");
    provider3.setDescription("Le centre Aquabike seventeen vous accueille à Paris, 75017, dans le quartier Cardinet/Levis du 17ème arrondissement à quelques minutes du métro Malesherbes dans un centre dédié à la forme et au bien-être.");
    provider3.setImage("img/provider/seventeen.png");
    provider3.setMap("http://goo.gl/maps/K1ENg");
    providerDao.create(provider3);

    Provider provider4 = new Provider();
    provider4.setAddress(addressProvider4);
    provider4.setName("Musée du Louvre");
    provider4.setPhoneNumber("+ 33 (0)1 40 20 53 17");
    provider4.setEmail("contact@musee-louvre.fr");
    provider4.setDescription("Le musée du Louvre est l'un des plus grands musées du monde et le plus grand musée de Paris par sa surface de 210 000 m2 dont 60 600 consacrés aux expositions4. Situé au cœur de la ville, entre la rive droite de la Seine et la rue de Rivoli, dans le 1er arrondissement, le bâtiment est un ancien palais royal, le palais du Louvre.");
    provider4.setImage("img/provider/musee.png");
    provider4.setMap("http://goo.gl/maps/Qjoaq");
    providerDao.create(provider4);

    Provider provider5 = new Provider();
    provider5.setAddress(addressProvider5);
    provider5.setName("Mairie de Bayonne");
    provider5.setPhoneNumber("+33 5 59 46 60 60");
    provider5.setEmail("contact@maire-bayonne.fr");
    provider5.setDescription("Aux pieds des Pyrénées, sur la côte atlantique, Bayonne, ville d’art et d’histoire, bénéficie d'une situation géographique exceptionnelle : au cœur de la vieille ville devant le théâtre, la Nive qui descend du Pays Basque et l'Adour, fleuve gascon, se rejoignent avant de se jeter dans l'océan tout proche.");
    provider5.setImage("img/provider/bayonne.png");
    provider5.setMap("http://goo.gl/maps/MEc30");
    providerDao.create(provider5);

    //////////////////////////////////////////////////////
    ///                    User                        ///
    /////////////////////////////////////////////////////

    User user1 = new User();
    String dn1 = "12/08/1987";
    try
    {
      user1.setBirthday(sdf.parse(dn1));
    }
    catch (ParseException e)
    {
      e.printStackTrace();
    }
    user1.setEmail("jerome.duroch@hotmail.fr");
    user1.setFirstName("Jérôme");
    user1.setLastName("Duroch");
    user1.setAddress(addressUser1);
    user1.setType(Type.CUSTOMER);


    User user2 = new User();
    String dn2 = "24/01/1980";
    try
    {
      user2.setBirthday(sdf.parse(dn2));
    }
    catch (ParseException e)
    {
      e.printStackTrace();
    }
    user2.setEmail("naellie.loupec@hotmail.fr");
    user2.setFirstName("Naëllie");
    user2.setLastName("Loupec");
    user2.setAddress(addressUser2);
    user2.setType(Type.CUSTOMER);


    User user3 = new User();
    String dn3 = "06/09/1956";
    try
    {
      user1.setBirthday(sdf.parse(dn3));
    }
    catch (ParseException e)
    {
      e.printStackTrace();
    }
    user3.setEmail("paul.garnier@gmail.com");
    user3.setFirstName("Paul");
    user3.setLastName("Garnier");
    user3.setAddress(addressUser3);
    user3.setType(Type.CUSTOMER);


    //////////////////////////////////////////////////////
    ///                    Authentication             ///
    /////////////////////////////////////////////////////

    Authentication authentication1 = new Authentication();
    authentication1.setLogin("jerome");
    authentication1.setPassword("duroch");
    authentication1.setUser(user1);
    authenticationDao.create(authentication1);

    Authentication authentication2 = new Authentication();
    authentication2.setLogin("naellie");
    authentication2.setPassword("loupec");
    authentication2.setUser(user2);
    authenticationDao.create(authentication2);

    Authentication authentication3 = new Authentication();
    authentication3.setLogin("paul");
    authentication3.setPassword("garnier");
    authentication3.setUser(user3);
    authenticationDao.create(authentication3);


    //////////////////////////////////////////////////////
    ///                    Account                    ///
    /////////////////////////////////////////////////////

    Account account1 = new Account();
    String cda1 = "23/03/2000";
    try
    {
      account1.setCreationDate(sdf.parse(cda1));
    }
    catch (ParseException e)
    {
      e.printStackTrace();
    }
    account1.setUser(user1);
    accountDao.create(account1);

    Account account2 = new Account();
    String cda2 = "01/08/2003";
    try
    {
      account2.setCreationDate(sdf.parse(cda2));
    }
    catch (ParseException e)
    {
      e.printStackTrace();
    }
    account2.setUser(user2);
    accountDao.create(account2);

    Account account3 = new Account();
    String cda3 = "06/09/2011";
    try
    {
      account3.setCreationDate(sdf.parse(cda3));
    }
    catch (ParseException e)
    {
      e.printStackTrace();
    }
    account3.setUser(user3);
    accountDao.create(account3);

    //////////////////////////////////////////////////////
    ///                    Product                    ///
    /////////////////////////////////////////////////////

    Product product1 = new Product();
    product1.setProvider(provider1);
    product1.setName("Château de Versailles");
    product1.setPrice(15.50);
    product1.setDescription("Visite de deux heures du château de Versaillec avec guide en passant par la galerie des glaces.");
    String ld1 = "21/12/2013";
    try
    {
      product1.setLimitedDate(sdf.parse(ld1));
    }
    catch (ParseException e)
    {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    String cd1 = "21/06/2013";
    try
    {
      product1.setCreationDate(sdf.parse(cd1));
    }
    catch (ParseException e)
    {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    product1.setProductType(ProductType.Culture);
    product1.setImage("img/product/chateau.png");
    productDao.create(product1);

    Product product2 = new Product();
    product2.setProvider(provider1);
    product2.setName("Le malade imaginaire");
    product2.setPrice(35.50);
    product2.setDescription("Venez assistez au Malade Imaginaire de Molière dans le théâtre Montanssier à deux pas du château de Versailles.");
    String ld2 = "10/02/2014";
    try
    {
      product2.setLimitedDate(sdf.parse(ld2));
    }
    catch (ParseException e)
    {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    String cd2 = "15/08/2013";
    try
    {
      product2.setCreationDate(sdf.parse(cd2));
    }
    catch (ParseException e)
    {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    product2.setProductType(ProductType.Culture);
    product2.setImage("img/product/theatre.png");
    productDao.create(product2);

    Product product3 = new Product();
    product3.setProvider(provider1);
    product3.setName("Initiation aviron");
    product3.setPrice(22.50);
    product3.setDescription("Initiation à l'aviron dans les bassins du parc du Château de Versailles.");
    String ld3 = "22/10/2013";
    try
    {
      product3.setLimitedDate(sdf.parse(ld3));
    }
    catch (ParseException e)
    {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    String cd3 = "15/05/2013";
    try
    {
      product3.setCreationDate(sdf.parse(cd3));
    }
    catch (ParseException e)
    {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    product3.setProductType(ProductType.Sport);
    product3.setImage("img/product/aviron.png");
    productDao.create(product3);

    Product product4 = new Product();
    product4.setProvider(provider1);
    product4.setName("Balade à cheval");
    product4.setPrice(32.00);
    product4.setDescription("Profitez du grand air avec cette balade à cheval dans la forêt de Versailles.");
    String ld4 = "31/12/2013";
    try
    {
      product4.setLimitedDate(sdf.parse(ld4));
    }
    catch (ParseException e)
    {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    String cd4 = "01/01/2012";
    try
    {
      product4.setCreationDate(sdf.parse(cd4));
    }
    catch (ParseException e)
    {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    product4.setProductType(ProductType.Sport);
    product4.setImage("img/product/balladeCheval.png");
    productDao.create(product4);

    Product product5 = new Product();
    product5.setProvider(provider1);
    product5.setName("Soin aux feuilles d'or");
    product5.setPrice(92.00);
    product5.setDescription("Prenez soin de votre peau avec ce soin d'exception à la feuille d'or.");
    String ld5 = "25/05/2014";
    try
    {
      product5.setLimitedDate(sdf.parse(ld5));
    }
    catch (ParseException e)
    {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    String cd5 = "06/08/2013";
    try
    {
      product5.setCreationDate(sdf.parse(cd5));
    }
    catch (ParseException e)
    {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    product5.setProductType(ProductType.Beaute);
    product5.setImage("img/product/soinOr.png");
    productDao.create(product5);

    Product product6 = new Product();
    product6.setProvider(provider2);
    product6.setName("Epilation des 1/2 jambes");
    product6.setPrice(14.20);
    product6.setDescription("Epilation des demi jambes à la cire orientale.");
    String ld6 = "25/06/2014";
    try
    {
      product6.setLimitedDate(sdf.parse(ld6));
    }
    catch (ParseException e)
    {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    String cd6 = "19/04/2013";
    try
    {
      product6.setCreationDate(sdf.parse(cd6));
    }
    catch (ParseException e)
    {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    product6.setProductType(ProductType.Beaute);
    product6.setImage("img/product/epilation.png");
    productDao.create(product6);

    Product product7 = new Product();
    product7.setProvider(provider2);
    product7.setName("Soin aux algues");
    product7.setPrice(34.20);
    product7.setDescription("Soin du corps aux algues vertes de Touraine pour purifier et hydrater la peau.");
    String ld7 = "15/01/2014";
    try
    {
      product7.setLimitedDate(sdf.parse(ld7));
    }
    catch (ParseException e)
    {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    String cd7 = "23/08/2013";
    try
    {
      product7.setCreationDate(sdf.parse(cd7));
    }
    catch (ParseException e)
    {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    product7.setProductType(ProductType.Beaute);
    product7.setImage("img/product/soinAlgue.png");
    productDao.create(product7);

    Product product8 = new Product();
    product8.setProvider(provider2);
    product8.setName("Manucure");
    product8.setPrice(29.20);
    product8.setDescription("Une manucure aux huiles essentielles avec pose de vernis et soin des mains.");
    String ld8 = "29/03/2014";
    try
    {
      product8.setLimitedDate(sdf.parse(ld8));
    }
    catch (ParseException e)
    {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    String cd8 = "03/05/2013";
    try
    {
      product8.setCreationDate(sdf.parse(cd8));
    }
    catch (ParseException e)
    {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    product8.setProductType(ProductType.Beaute);
    product8.setImage("img/product/ongle.png");
    productDao.create(product8);

    Product product9 = new Product();
    product9.setProvider(provider3);
    product9.setName("Aquabike");
    product9.setPrice(33.80);
    product9.setDescription("Séance de 30min de vélo aquatique individuel avec jets hydromassants.");
    String ld9 = "25/05/2014";
    try
    {
      product9.setLimitedDate(sdf.parse(ld9));
    }
    catch (ParseException e)
    {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    String cd9 = "19/04/2013";
    try
    {
      product9.setCreationDate(sdf.parse(cd9));
    }
    catch (ParseException e)
    {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    product9.setProductType(ProductType.Sport);
    product9.setImage("img/product/aquabike.png");
    productDao.create(product9);

    Product product10 = new Product();
    product10.setProvider(provider4);
    product10.setName("Visite du Louvre");
    product10.setPrice(15.80);
    product10.setDescription("Visite guidée de 1h30 dans les galeries du musée du Louvre.");
    String ld10 = "15/08/2014";
    try
    {
      product10.setLimitedDate(sdf.parse(ld10));
    }
    catch (ParseException e)
    {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    String cd10 = "29/06/2013";
    try
    {
      product10.setCreationDate(sdf.parse(cd10));
    }
    catch (ParseException e)
    {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    product10.setProductType(ProductType.Culture);
    product10.setImage("img/product/louvre.png");
    productDao.create(product10);

    Product product11 = new Product();
    product11.setProvider(provider5);
    product11.setName("Cours de Kite Surf");
    product11.setPrice(35.90);
    product11.setDescription("Cours d'initiation ou de perfectionnement au kite surf sur la plage de Bayonne.");
    String ld11 = "30/09/2013";
    try
    {
      product11.setLimitedDate(sdf.parse(ld11));
    }
    catch (ParseException e)
    {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    String cd11 = "29/06/2013";
    try
    {
      product11.setCreationDate(sdf.parse(cd11));
    }
    catch (ParseException e)
    {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    product11.setProductType(ProductType.Sport);
    product11.setImage("img/product/kiteSurf.png");
    productDao.create(product11);

    Product product12 = new Product();
    product12.setProvider(provider5);
    product12.setName("Pédalo");
    product12.setPrice(19.00);
    product12.setDescription("Location d'une heure d'un pédalo pour naviguer sur l'eau.");
    String ld12 = "15/10/2013";
    try
    {
      product12.setLimitedDate(sdf.parse(ld12));
    }
    catch (ParseException e)
    {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    String cd12 = "01/04/2013";
    try
    {
      product12.setCreationDate(sdf.parse(cd12));
    }
    catch (ParseException e)
    {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    product12.setProductType(ProductType.Sport);
    product12.setImage("img/product/pedalo.png");
    productDao.create(product12);

    Product product13 = new Product();
    product13.setProvider(provider5);
    product13.setName("Chocolaterie de Bayonne");
    product13.setPrice(12.00);
    product13.setDescription("Apprenez comment se fabrique le chocolat et ses variantes, ses origines et son avenir.");
    String ld13 = "17/12/2013";
    try
    {
      product13.setLimitedDate(sdf.parse(ld13));
    }
    catch (ParseException e)
    {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    String cd13 = "16/06/2013";
    try
    {
      product13.setCreationDate(sdf.parse(cd13));
    }
    catch (ParseException e)
    {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    product13.setProductType(ProductType.Culture);
    product13.setImage("img/product/chocolat.png");
    productDao.create(product13);

    Product product14 = new Product();
    product14.setProvider(provider5);
    product14.setName("Soin au chocolat");
    product14.setPrice(37.00);
    product14.setDescription("Offrez de la gourmandise à votre peau avec ce soin du corps regénérant au chocolat.");
    String ld14 = "14/02/2014";
    try
    {
      product14.setLimitedDate(sdf.parse(ld14));
    }
    catch (ParseException e)
    {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    String cd14 = "16/08/2013";
    try
    {
      product14.setCreationDate(sdf.parse(cd14));
    }
    catch (ParseException e)
    {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    product14.setProductType(ProductType.Beaute);
    product14.setImage("img/product/soinChoco.png");
    productDao.create(product14);

    Product product15 = new Product();
    product15.setProvider(provider5);
    product15.setName("Visite du phare");
    product15.setPrice(8.00);
    product15.setDescription("Lancez vous le défi de monter les 253 marches du Phare pour admirer la vue et écouter son gardien vous raconter son histoire.");
    String ld15 = "31/11/2013";
    try
    {
      product15.setLimitedDate(sdf.parse(ld15));
    }
    catch (ParseException e)
    {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    String cd15 = "01/04/2013";
    try
    {
      product15.setCreationDate(sdf.parse(cd15));
    }
    catch (ParseException e)
    {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    product15.setProductType(ProductType.Beaute);
    product15.setImage("img/product/phare.png");
    productDao.create(product15);


    //////////////////////////////////////////////////////
    ///                    LineItem                   ///
    /////////////////////////////////////////////////////

    Lineitem lineitem1 = new Lineitem();
    lineitem1.setProduct(product1);
    lineitem1.setQuantity(1);
    lineDao.create(lineitem1);

    Lineitem lineitem2 = new Lineitem();
    lineitem2.setProduct(product3);
    lineitem2.setQuantity(1);
    lineDao.create(lineitem2);

    Lineitem lineitem3 = new Lineitem();
    lineitem3.setProduct(product9);
    lineitem3.setQuantity(2);
    lineDao.create(lineitem3);

    Lineitem lineitem4 = new Lineitem();
    lineitem4.setProduct(product14);
    lineitem4.setQuantity(1);
    lineDao.create(lineitem4);

    Lineitem lineitem5 = new Lineitem();
    lineitem5.setProduct(product10);
    lineitem5.setQuantity(3);
    lineDao.create(lineitem5);

    Lineitem lineitem6 = new Lineitem();
    lineitem6.setProduct(product13);
    lineitem6.setQuantity(1);
    lineDao.create(lineitem6);

    Lineitem lineitem7 = new Lineitem();
    lineitem7.setProduct(product8);
    lineitem7.setQuantity(1);
    lineDao.create(lineitem7);

    Lineitem lineitem8 = new Lineitem();
    lineitem8.setProduct(product15);
    lineitem8.setQuantity(2);
    lineDao.create(lineitem8);

    Lineitem lineitem9 = new Lineitem();
    lineitem9.setProduct(product5);
    lineitem9.setQuantity(1);
    lineDao.create(lineitem9);

    //////////////////////////////////////////////////////
    ///                    Order                      ///
    /////////////////////////////////////////////////////

    Order order1 = new Order();
    order1.setOrderStatus(OrderStatus.PAID);
    order1.setCreationDate(new Date());
    order1.setAccount(account1);
    order1.getLineItems().add(lineitem1);
    orderDao.create(order1);

    Order order2 = new Order();
    order2.setOrderStatus(OrderStatus.PAID);
    order2.setCreationDate(new Date());
    order2.setAccount(account1);
    order2.getLineItems().add(lineitem2);
    order2.getLineItems().add(lineitem3);
    orderDao.create(order2);

    Order order3 = new Order();
    order3.setOrderStatus(OrderStatus.PAID);
    order3.setCreationDate(new Date());
    order3.setAccount(account2);
    order3.getLineItems().add(lineitem4);
    orderDao.create(order3);

    Order order4 = new Order();
    order4.setOrderStatus(OrderStatus.PAID);
    order4.setCreationDate(new Date());
    order4.setAccount(account3);
    order4.getLineItems().add(lineitem5);
    orderDao.create(order4);

    Order order5 = new Order();
    order5.setOrderStatus(OrderStatus.CANCELLED);
    order5.setCreationDate(new Date());
    order5.setAccount(account3);
    order5.getLineItems().add(lineitem6);
    orderDao.create(order5);

    Order order6 = new Order();
    order6.setOrderStatus(OrderStatus.PAID);
    order6.setCreationDate(new Date());
    order6.setAccount(account3);
    order6.getLineItems().add(lineitem7);
    order6.getLineItems().add(lineitem8);
    order6.getLineItems().add(lineitem9);
    orderDao.create(order6);

    //////////////////////////////////////////////////////
    ///                    Payment                    ///
    /////////////////////////////////////////////////////

    Payment payment1 = new Payment();
    payment1.setOrder(order1);
    payment1.setDatePayment(new Date());
    payment1.setTotalPrice(order1.getTotalPrice());
    paymentDao.create(payment1);

    Payment payment2 = new Payment();
    payment2.setOrder(order2);
    payment2.setDatePayment(new Date());
    payment2.setTotalPrice(order2.getTotalPrice());
    paymentDao.create(payment2);

    Payment payment3 = new Payment();
    payment3.setOrder(order3);
    payment3.setDatePayment(new Date());
    payment3.setTotalPrice(order3.getTotalPrice());
    paymentDao.create(payment3);

    Payment payment4 = new Payment();
    payment4.setOrder(order4);
    payment4.setDatePayment(new Date());
    payment4.setTotalPrice(order4.getTotalPrice());
    paymentDao.create(payment4);

    Payment payment5 = new Payment();
    payment5.setOrder(order6);
    payment5.setDatePayment(new Date());
    payment5.setTotalPrice(order6.getTotalPrice());
    paymentDao.create(payment5);

    return null;
  }

}
